package com.test.fastdfs.demo.service;

import com.test.fastdfs.demo.entity.FileModel;
import com.test.fastdfs.demo.repository.FileDao;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileServiceImpl implements  FileService{
    @Autowired
    private FileDao fileDao;

    @Override
    public FileModel createFile(FileModel fileModel){
        return fileDao.save(fileModel);
    }
    @Override
    public  void deleteFile(FileModel fileModel){
        fileDao.delete(fileModel);
    }
    @Override
    public List<FileModel> findAllByCondition(Example<FileModel> e){
        return fileDao.findAll(e);
    }

}
